﻿<%@ WebHandler Language="C#" Class="hEditPwd" %>

using System;
using System.Web;
using System.Collections.Generic;
using System.Web.SessionState;
using BLL.System;
using CommonLib; 

public class hEditPwd : IHttpHandler, IRequiresSessionState
{
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        string result = string.Empty;
        if (context.Session["user"] == null)
        {
            context.Response.Clear();
            throw new Exception("登录超时");
        }
        try
        {
            switch (context.Request.QueryString["action"])
            {
                case "editPwd":
                    result=editPwd(context);
                    break;

            }
        }
        catch (Exception ex)
        {
            var error = new Entities.Status { Success = false, Message = ex.Message };
            result = error.ToJson();
            
        }
        finally
        {
            context.Response.Write(result);
        }

    }

    private string  editPwd(HttpContext context)
    {
        return UserBO.editPwd(context);

    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}